#替换为阿里的apt镜像
# 安装
sudo apt-get update &&
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common &&
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - &&
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" &&
sudo apt-get -y update &&
sudo apt-get -y install docker-ce &&

# add 镜像
sudo mkdir -p /etc/docker &&
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "log-driver":"json-file",
  "registry-mirrors": ["https://jdju8r3i.mirror.aliyuncs.com"],
  "log-opts": {"max-size":"20m", "max-file":"3"}
}
EOF
sudo systemctl daemon-reload &&
sudo systemctl restart docker &&
sudo docker -v

